import request from '../utils/request';
import { parse } from 'querystring';
import { REST, BASE, RESTS } from '../utils/Api';

export async function fetchConfig(params) {
  return request(`${BASE}/config/object/getByApiKey`, {
    method: 'POST',
    params,
  });
}

export async function fetchData(payload) {
  return request(`${RESTS}/json/${payload.apiKey}/switch/data`, {
    method: 'POST',
    params: payload,
  });
}
export async function updateEntity(payload) {
  return request(`${RESTS}/json/${payload.apiKey}/open/update`, {
    method: 'POST',
    params: payload,
  });
}
